package fr.cpe.dp.projet2.model.music;

import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Sequence;

/**
 *
 * @author Benoit
 */
public class FileMusic implements IMusic {
    File file;
    
    public FileMusic(File file) {
        this.file = file;
    }
    
    @Override
    public Sequence getSequence() throws InvalidMidiDataException {
        Sequence seq = null;
        try {
            seq = MidiSystem.getSequence(file);
        } catch (IOException ex) {
            Logger.getLogger(FileMusic.class.getName()).log(Level.SEVERE, null, ex);
        }
        return seq;
    }
}
